package newsEditor;

import reader.AckEvent;
import event.Event;
import event.Filter;

public class AckFilter implements Filter {

	private String sourceName;

	public AckFilter(String sourceName) {
		this.sourceName = sourceName;
	}

	@Override
	public boolean apply(Event event) {
		if (!(event instanceof AckEvent)) {
			return false;
		}
		if (((AckEvent)event).getNews().getNewsAuthor().equals(sourceName)) {
			return true;
		}
		return false;
	}
}
